﻿using System;
using System.Collections.Generic;

namespace Isaac.Joy.Menu.Module
{
    /// <summary>
    /// 菜单接口
    /// </summary>
    public interface IMenu : IComparable
    {
        /// <summary>
        /// 菜单名称
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// 图标
        /// </summary>
        string Icon { get; set; }

        /// <summary>
        /// 动作
        /// </summary>
        MenuAction Action { get; set; }

        /// <summary>
        /// 是否为子节点
        /// </summary>
        bool IsLeaf { get; }

        /// <summary>
        /// 排序编号
        /// </summary>
        int Order { get; set; }

        /// <summary>
        /// 权限
        /// </summary>
        string Permission { get; set; }

        /// <summary>
        /// 子菜单
        /// </summary>
        IEnumerable<IMenu> Childrens { get; }

        /// <summary>
        /// 添加子菜单
        /// </summary>
        /// <param name="menu">子菜单</param>
        void Add(IMenu menu);
    }
}
